div#admin-edit-post.container-fluid.view.col-sm-12.col-md-10.col-lg-8
    script#post-save-delete(type="text/html")
        include admin-post-save-delete-tpl
    div.panel.panel-default
        div.panel-body
            form.form-horizontal(role='form', name='postForm', data-bind="submit: save.do, with: post")
                div.form-group(data-bind="template: {name: 'post-save-delete', data: $parent}")
                div.form-group
                    label.col-sm-2.control-label(for="title"
                                                data-bind="translate: 'TITLE'")
                    div.col-sm-10
                        input#title.form-control(type="text"
                                                data-bind="value: title, valueUpdate: 'input'"
                                                required
                                                placeholder="Post title")
                div.form-group
                    label.col-sm-2.control-label(for="slug"
                                                data-bind="translate: 'SLUG'")
                    div.col-sm-4
                        input#slug.form-control(type="text"
                                                data-bind="value: slug, valueUpdate: 'input'"
                                                placeholder="Post url here")
                    label.col-sm-6
                        code(data-bind="text: $parent.urlPreview")
                div.form-group
                    label.col-sm-2.control-label(for="date",
                                                data-bind="translate: 'DATE'")
                    div.col-sm-4
                        input#date.form-control(type="date"
                                                data-bind="dateValue: date"
                                                required
                                                placeholder="yyyy-MM-dd")
                    label.col-sm-6
                        code(data-bind="dateText: date")
                div.form-group
                    label.col-sm-2.control-label(for="content"
                                                data-bind="translate: 'TEXT'")
                    div.col-sm-10
                        textarea#content.form-control(data-bind="value: content, valueUpdate: 'input'"
                                                    placeholder="Post text here"
                                                    rows="10")
                div.form-group
                    div.col-sm-10.col-sm-offset-2
                        label.checkbox-inline
                            input(type="checkbox"
                                data-bind="checked: $parent.contentPreview")
                            span(data-bind="translate: 'PREVIEW'")
                div.form-group(data-bind="if: $parent.contentPreview")
                    label.col-sm-2.control-label(for="preview", data-bind="translate: 'PREVIEW'")
                    div#preview.col-sm-10.form-control-static.bg-info
                        p(data-bind="html: content")
                        p.tags-list(data-bind="foreach: {data: tags, as: 'tag'}")
                            span.label.label-info(data-bind="text: tag")
                div.form-group
                    label.col-sm-2.control-label(for="tags",
                                                data-bind="translate: 'TAGS'")
                    div.col-sm-10
                        input#tags.form-control(data-bind="listText: tags, listSeparator: ' ', valueUpdate: 'input'"
                                                placeholder="Space separated tags")
                div.form-group
                    label.col-sm-2.control-label(for="metatitle"
                                                data-bind="translate: 'METATITLE'")
                    div.col-sm-10
                        input#metatitle.form-control(type="text",
                                                    data-bind="value: metaTitle, valueUpdate: 'input'"
                                                    placeholder="Meta title of page here")
                div.form-group
                    label.col-sm-2.control-label(for="metadescription"
                                                data-bind="translate: 'METADESCRIPTION'")
                    div.col-sm-10
                        textarea#metadescription.form-control(data-bind="value: metaDescription, valueUpdate: 'input'"
                                                            placeholder="Meta description of page here (few words)")
                div.form-group
                    label.col-sm-2.control-label(for="image"
                                                data-bind="translate: 'POST_IMAGE'")
                    div.col-sm-4
                        input#image.form-control(type="url"
                                                data-bind="value: image, valueUpdate: 'input'"
                                                placeholder="Image url")
                    div.col-sm-6
                        img(width='150', data-bind="attr: {src: image}, visible: image")
                div.form-group
                    div.col-sm-10.col-sm-offset-2
                        label.checkbox-inline
                            input#featured(type="checkbox", data-bind="checked: featured")
                            span(data-bind="translate: 'FEATURED'")
                        label.checkbox-inline
                            input#draft(type="checkbox", data-bind="checked: draft")
                            span(data-bind="translate: 'DRAFT'")
                div.form-group(data-bind="template: {name: 'post-save-delete', data: $parent}")

